const fs = require("fs");
const path = require("path");

var oldPath = path.join(__dirname, "/1.txt");
var newPath = path.join(__dirname, "/10.txt");

fs.renameSync(oldPath, newPath); //文件重命名，将1.txt重命名为10.txt